#pragma once
#include "Stream.h"

namespace System
{
	namespace IO
	{
		class SYSTEM_API FileStream :
			public Stream
		{
		public:
//			FileStream(LPCTSTR fileName, bool write = false, bool append = false, bool create = false);
			FileStream(LPCWSTR fileName, bool write = false, bool append = false, bool create = false);

			virtual ~FileStream();
			
			virtual int  read(MemoryBuffer& memBuf, int offset, size_t count);
			virtual int  readByte(byte& value);

			virtual ud_uint64 seek(ud_uint64 offset, SeekOrigin origin) ;
			virtual void setLength(ud_uint64 value);
			virtual int write(const MemoryBuffer& memBuf, int offset = 0, size_t count = 0);
			virtual void writeByte(byte value);
		private:
#ifdef WIN32
			HANDLE					m_handle;
#else 
			int						m_handle;
#endif
		};
	}
}